<template>
    <van-swipe :autoplay="3000" lazy-render>
        <van-swipe-item v-for="item in imgData" :key="item" @click="item.method">
            <img :src="item.imgSrc" />
        </van-swipe-item>
    </van-swipe>
</template>

<script>
export default {
    name: 'swipe',
    props: ['imgData'],
    data() {
        return {
            // imgList: [
            //     {
            //         imgSrc: 'https://img01.yzcdn.cn/vant/apple-1.jpg',
            //         method: () => {
            //             console.log('图片被点击')
            //         }
            //     },
            //      {
            //         imgSrc: 'https://img01.yzcdn.cn/vant/apple-2.jpg',
            //         method: () => {
            //             console.log('图片被点击')
            //         }
            //     }
            // ],
        }
    },
    methods: {
        
    }
}
</script>

<style lang="scss" scoped>
.van-swipe {
    height: 100%;
    img {
        height: 100%;
        width: 100%;
    }
}
</style>